$(window).load(function() {
    var numTopPhotos = $(".slides li").length;
    var randPhoto = Math.floor(Math.random()*numTopPhotos);
    $('.flexslider').flexslider({
        animation: "fade",
        slideToStart: randPhoto,
        slideshowSpeed: 5000,
        pauseOnHover: true
    });     
});

